package cn.swust.designpatternlearningplatform.domain.enums;

import cn.swust.designpatternlearningplatform.common.exception.CustomException;

public enum TopicDiffEnum {
    EASY("简单"),
    ORDINARY("中等"),
    DIFFICULTY("困难")
    ;
    public final String typeName;
    TopicDiffEnum(String typeName) {
        this.typeName = typeName;
    }

    public static String topicDiff(Integer choice) {
        switch (choice){
            case 1: return TopicDiffEnum.EASY.typeName;
            case 2: return TopicDiffEnum.ORDINARY.typeName;
            case 3: return TopicDiffEnum.DIFFICULTY.typeName;
            default:
                throw new CustomException("状态错误");
        }
    }
}
